<template>
	<view>
		<view>
			<button @click="gotoFileList()">下载文件</button>
		</view>
		<text>\n</text>
		<text>.&nbsp;&nbsp;&nbsp;历史记录</text>
		<view v-for="(item,i) in history" :key="i" @click="open(item.url)">
			
			<text>
				\n
				&nbsp;&nbsp;&nbsp;{{item.name}}
				<text style="color: #999999;">——————————————————————————————</text>
			</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				history:{}
			}
		},
		onShow() {
			this.history=uni.getStorageSync("history");
		}
		,
		methods: {
			gotoFileList(){
				uni.navigateTo({url:'../fileList/fileList'});
			},
			open(url){
				uni.setStorageSync("prefileUrl",url);
				uni.navigateTo({url:'../preview/preview'});
			}
		}
	}
</script>

<style>

</style>
